package com.xbongbong.saas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.saas.enums.dictionary.ShipStatusEnum;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @author feng.zheng
 * @description: 退货方式
 * @date 2021/1/19 8:15 下午
 */
@Getter
public enum RefundMethodEnum {
    ONLY_MONEY(1, "enum.refundMethod.name.only_money", Arrays.asList(ShipStatusEnum.UNSHIPPED.getCode(),ShipStatusEnum.DELIVERED.getCode(),ShipStatusEnum.SHIPPED.getCode(),ShipStatusEnum.CLOSED.getCode())),
    ONLY_GOODS(2, "enum.refundMethod.name.only_goods", Arrays.asList(ShipStatusEnum.DELIVERED.getCode(),ShipStatusEnum.SHIPPED.getCode(),ShipStatusEnum.CLOSED.getCode())),
    GOODS_MONEY(3, "enum.refundMethod.name.goods_money", Arrays.asList(ShipStatusEnum.DELIVERED.getCode(),ShipStatusEnum.SHIPPED.getCode(),ShipStatusEnum.CLOSED.getCode())),
    ;

    private int type;

    private String name;

    private List<String> status;

    RefundMethodEnum(int type, String name, List<String> status) {
        this.type = type;
        this.name = name;
        this.status = status;
    }
    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }

    public static List<Integer> getMoneyMethod() {
        return Arrays.asList(RefundMethodEnum.ONLY_MONEY.type, RefundMethodEnum.GOODS_MONEY.type);
    }
}
